var username;
var password;
onload = function(){
    username = sessionStorage.getItem("username");
    password = sessionStorage.getItem("password");
    if(!username || !password){
        location = "login.html";
    }
    $("#logout").click(function(){
        sessionStorage.removeItem("username");
        sessionStorage.removeItem("password");
        location = "login.html";
    });
    var request = new XMLHttpRequest();
                        
    request.open("GET","https://localhost:8181/auth/resources/hello",true,username,password);//true (synchroon)
    request.onload = function(){
        if(request.status ===200){
            $("#hello").text(request.responseText);
            
        }else{
            console.log("Fout bij inladen bericht");
        }
    };
    request.send(null);
};